#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <wiringPi.h>
#include <pcf8591.h>

int main(int argc,char *argv)
{
    wiringPiSetup();
    pcf8591Setup(65,0x48);

    int ai1,ai2,ai3,ai4;
    int ao1;

    ai1 = analogRead(65);
    ai2 = analogRead(66);
    ai3 = analogRead(67);
    ai4 = analogRead(68);

    printf("analog read 1 = %d\n",ai1);
    printf("analog read 2 = %d\n",ai2);
    printf("analog read 3 = %d\n",ai3);
    printf("analog read 4 = %d\n",ai4);

    analogWrite(65,125);

    return 0;
}
